package com.ssy.lingxi.member.merchant.api.model.vo.paas;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 新增菜单及其关联按钮接口参数VO
 * @author 万宁
 * @version 2.0.0
 * @date 2020-08-03
 */
public class MenuButtonVO implements Serializable {
    private static final long serialVersionUID = 7762518631465679498L;

    /**
     * PaaS层的Id
     */
    @NotNull(message = "菜单Id不能为空")
    @Positive(message = "菜单Id要大于0")
    private Long paasId;

    /**
     * PaaS的父Id，0表示没有父节点
     */
    @NotNull(message = "父菜单Id不能为空")
    @PositiveOrZero(message = "父菜单Id要大于等于0")
    private Long parentId;

    /**
     * 菜单名称
     */
    @NotBlank(message = "菜单名称不能为空")
    @Size(max = 50, message = "菜单名称最长50个字符")
    private String title;

    /**
     * 菜单前端Url
     */
    @NotBlank(message = "菜单Url不能为空")
    @Size(max = 400, message = "菜单Url最长400个字符")
    private String url;

    /**
     * 菜单编码
     */
    @Size(max = 200, message = "菜单编码最长100个字符")
    private String code;

    /**
     * 菜单顺序
     */
    @NotNull(message = "菜单顺序不能为空")
    @Positive(message = "菜单顺序要大于1")
    private Integer order;

    /**
     * 菜单说明
     */
    private String remark;

    /**
     * 菜单状态 0-禁用 1-启用
     */
    @Min(value = 0, message = "菜单状态： 0-禁用 1-启用")
    @Max(value = 1, message = "菜单状态： 0-禁用 1-启用")
    private Integer status;

    /**
     * 菜单适用的平台客户端，1-能力平台，2-App，99-平台后台
     */
    private Integer source;

    /**
     * 是否上移一层
     */
    private Integer up;

    /**
     * 菜单属性
     */
    private Map<String, Object> attrs;

    /**
     * 是否可配置数据权限 0-否，1-是
     */
    private Integer dataAuthConfig;

    /**
     * 菜单关联的按钮列表
     */
    private List<ButtonAddVO> buttons;

    public Long getPaasId() {
        return paasId;
    }

    public void setPaasId(Long paasId) {
        this.paasId = paasId;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getOrder() {
        return order;
    }

    public void setOrder(Integer order) {
        this.order = order;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public List<ButtonAddVO> getButtons() {
        return buttons;
    }

    public void setButtons(List<ButtonAddVO> buttons) {
        this.buttons = buttons;
    }

    public Integer getSource() {
        return source;
    }

    public void setSource(Integer source) {
        this.source = source;
    }

    public Integer getUp() {
        return up;
    }

    public void setUp(Integer up) {
        this.up = up;
    }

    public Map<String, Object> getAttrs() {
        return attrs;
    }

    public void setAttrs(Map<String, Object> attrs) {
        this.attrs = attrs;
    }

    public Integer getDataAuthConfig() {
        return dataAuthConfig;
    }

    public void setDataAuthConfig(Integer dataAuthConfig) {
        this.dataAuthConfig = dataAuthConfig;
    }

    public static class ButtonAddVO implements Serializable {
        private static final long serialVersionUID = -7955212792188260143L;

        /**
         * Pass的Id
         */
        @NotNull(message = "按钮paasId要大于0")
        @Positive(message = "按钮paasId要大于0")
        private Long paasId;

        /**
         * 按钮名称不能为空
         */
        @NotNull(message = "按钮名称不能为空")
        @Size(max = 20, message = "按钮名称最长20个字符")
        private String name;

        /**
         * 按钮关联的Url
         */
        @NotNull(message = "按钮Url不能为空")
        @Size(max = 400, message = "按钮Url最长400个字符")
        private String url;

        /**
         * 按钮描述
         */
        @Size(max = 100, message = "按钮描述最长100个字符")
        private String remark;

        /**
         * 按钮编码
         */
        private String code;

        /**
         * 按钮属性
         */
        private Map<String, Object> attrs;

        public Long getPaasId() {
            return paasId;
        }

        public void setPaasId(Long paasId) {
            this.paasId = paasId;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getRemark() {
            return remark;
        }

        public void setRemark(String remark) {
            this.remark = remark;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public Map<String, Object> getAttrs() {
            return attrs;
        }

        public void setAttrs(Map<String, Object> attrs) {
            this.attrs = attrs;
        }
    }
}
